<%-- 
    Document   : ConsulteCreneau
    Created on : 24 déc. 2013, 18:17:20
    Author     : frantz
--%>

<%@page import="Objet.Etudiant"%>
<%@page import="Objet.Enseignant"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.Iterator"%>
<%@page import="java.sql.Date"%>
<%@page import="Objet.Absence"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        
        <jsp:useBean id="co" scope="request" class="Objet.QueryBD"/>
        <jsp:useBean id="monAuth" scope="session" class="Form.FirstActionForm"/>
        <jsp:useBean id="monRel" scope="session" class="Form.ReleveForm"/>

                              
        
        
        
        <%
            Enseignant monEnseignant = co.creerEnseignant
                    ((String)monAuth.getLogin(),(String)monAuth.getMdp());
        %>
     
            

        <form method="POST" >
            <center><h1>Liste des eleves du creneau</h1>
<table border ="1">
                <tr>
                    <th>Nom etudiant</th>
                    <th>Prenom etudiant</th>
                    
                    <th>Nom enseignant</th>
                    <th>module</th>
                    <th>n°promotion</th>

                    
                    <th>date creneau</th>
                    <th>heure debut</th>
                    <th>heure fin</th>
                    <th>statut</th>
                </tr>
            <%
                String id_promotion = co.maPromo(monRel.getCreneau());
               
                ArrayList<Etudiant> ListEtu = 
                        new ArrayList(co.listeEtudiantsPromo(id_promotion));
                
                Iterator<Etudiant> monIt = ListEtu.iterator();
                
                int id_etu;
                String nom_etu;
                String prenom_etu;
                
                
             
                while(monIt.hasNext())
                    {
                        Etudiant UnEtudiant = monIt.next();
                        
                        
                        id_etu = UnEtudiant.getNetudiant();
                        nom_etu = co.nomEtudiant(id_etu);
                        prenom_etu = co.prenomEtudiant(id_etu);
                        
                        
 
                        %>
                        <tr>

                                <td>
                                     <% out.println(nom_etu.toString()); %> 
 
                                </td>
                                
                                <td> 
                                    <% out.println(prenom_etu.toString()); %>  
                                </td>

                                <td>   
                                    <INPUT type="checkbox" name="id_etu" value="absent :">
                                </td>
                                           
                    <% } %>

            </table>
        </form>  
                    
        <html:errors/>
    </body>
</html>
